# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_gemname=path_expander
pkgname=ruby-${_gemname}
pkgver=1.1.1
pkgrel=1
pkgdesc='Helps pre-process command-line arguments expanding directories into their constituent file'
url='https://github.com/seattlerb/path_expander'
arch=('any')
license=('MIT')
depends=('ruby')
makedepends=('ruby-rdoc' 'ruby-rake' 'ruby-hoe')
checkdepends=('ruby-minitest')
options=('!emptydirs')
source=(${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('68babcd26eb17b47192ec05a01ec767c5c30921fcd05143f72834a19dc58148df390f3f99788ec0b1ab55fd327da1227a0780e423fb67508f585a9f5b58194e8')
b2sums=('334330d1c7c70a2aaffcd693db4f00b8dab09fa5f7a567354aa62803601d958ea128a79b27d9e91431b81bf860c36dd90a56f28412d8284b970cb1dfe3bb59a4')

build() {
  cd ${_gemname}-${pkgver}
  sed -r 's|~>|>=|g' -i Rakefile
  rake gem
}

check() {
  cd ${_gemname}-${pkgver}
  rake test
}

package() {
  cd ${_gemname}-${pkgver}
  local _gemdir="$(gem env gemdir)"
  gem install --ignore-dependencies --no-user-install -i "${pkgdir}${_gemdir}" \
    -n "${pkgdir}/usr/bin" pkg/${_gemname}-${pkgver}.gem

  install -Dm 644 README.rdoc History.rdoc -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 README.rdoc -t "${pkgdir}/usr/share/licenses/${pkgname}"

  rm -r "${pkgdir}/${_gemdir}/"{cache,gems/${_gemname}-${pkgver}/test}
}

# vim: ts=2 sw=2 et:
